package com.sq.partner.manager.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.sq.partner.manager.dao.ITradInsuPlanGroupDao;
import com.sq.partner.manager.mybatis.model.TradInsuPlanGroup;

@Repository
public class TradInsuPlanGroupDaoImpl extends BaseDaoImpl implements ITradInsuPlanGroupDao {

	@Override
	public boolean addTradInsuPlanGroup(TradInsuPlanGroup group)
			throws Exception {
		return this.add("insertTradInsuPlanGroup", group);
	}

	@Override
	public boolean updateTradInsuPlanGroup(TradInsuPlanGroup group)
			throws Exception {
		return this.add("updateTradInsuPlanGroupByPlanNo", group);
	}

	@Override
	public boolean deleteTradInsuPlanGroup(TradInsuPlanGroup group)
			throws Exception {
		return this.delete("delTradInsuPlanGroup", group);
	}

	@Override
	public List<TradInsuPlanGroup> queryTradInsuPlanGroup(TradInsuPlanGroup group) throws Exception {
		Object obj = this.queryList("queryTradInsuPlanGroup", group);
		if(null!=obj){
			return (List<TradInsuPlanGroup>)obj;
		}
		return null;
	}

	@Override
	public boolean deleteTradInsuPlanGroup(String insuPlanNumber)
			throws Exception {
		return this.delete("delTradInsuPlanGroupbyInsuNo", insuPlanNumber);
	}

	@Override
	public boolean updateIsRequired(TradInsuPlanGroup group) throws Exception {
		return this.add("updateTradInsuPlanGroupNotNull", group);
	}

	@Override
	public List<TradInsuPlanGroup> impNlifeGroup(Map<String, Object> map)
			throws Exception {
		return this.queryList("impNlifeGroupByMap", map);
	}
	@Override
	public List<TradInsuPlanGroup> searchTradInsuPlanGroupsByplanCode(
			Map<String, Object> maps) throws Exception {
		// TODO Auto-generated method stub
		return this.queryList("searchTradInsuPlanGroupsByplanCode", maps);
	}

	@Override
	public void addPlanGroupList(List<TradInsuPlanGroup> group)
			throws Exception {
		// TODO Auto-generated method stub
		this.batchInsert("insertTradInsuPlanGroup", group);
	}

	@Override
	public List<Map<String, Object>> impNlifeGroup1(Map<String, Object> map)
			throws Exception {
		// TODO Auto-generated method stub
		return this.queryList("impNlifeGroupByMap1", map);
	}
	
	@Override
	public List<Map<String, Object>> impRealGroupPlan(Map<String, Object> map)
			throws Exception {
		return this.queryList("impRealGroupPlanByIdMap", map);
	}


}
